import instance from '../../utils/request'

const base = 'cookcar-plat/'

// 获取详情信息
export function getDeatilMsg(id) {
  const config = {
    method: 'get',
    url: `${base}used/carC/APP/${id}`,
  }
  return instance(config)
}
// 用户登录后获取详情页信息
export function isLike(usedCarId) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/isLike?usedCarId=${usedCarId}`,
  }
  return instance(config)
}
// 添加足迹
export function addFoot(usedCarId) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/addFoot?usedCarId=${usedCarId}`,
  }
  return instance(config)
}
// 添加收藏
export function addLike(usedCarId) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/addLike?usedCarId=${usedCarId}`,
  }
  return instance(config)
}
// 取消收藏
export function cancelLike(usedCarId) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/cancelLike?usedCarId=${usedCarId}`,
  }
  return instance(config)
}
// 查询收藏
export function getMyLike(vnName) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/getMyLike?vnName=${vnName}`,
  }
  return instance(config)
}
// 查询足迹
export function getMyFoot(vnName) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/getMyFoot?vnName=${vnName}`,
  }
  return instance(config)
}
// 删除足迹
export function deleteFootprint(vId) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/myDelete?type=02&usedCarId=${vId}`,
  }
  return instance(config)
}
// 删除收藏
export function deleteCollection(vId) {
  const config = {
    method: 'get',
    url: `${base}mobile/C/myDelete?type=01&usedCarId=${vId}`,
  }
  return instance(config)
}